<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class StoreRegisterRequest extends BasicRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'store_name'		=> 'bail|required|min:2|max:32',
            'store_mobile'		=> 'bail|required',
			'store_type'		=> 'bail|required',
			'store_class'       => 'bail|required',
			'province_id'		=> 'bail|required',
			'city_id'		    => 'bail|required',
			'area_id'	    	=> 'bail|required',
			'village_id'		=> 'bail|required',
			'lat'		        => 'bail|required',
			'lng'		        => 'bail|required',
			'address'	    	=> 'bail|required|min:4',
			'business_img'		=> 'bail|required|min:4',
        ];
    }
    
    public function messages()
	{
		return [
			'store_name.required'	    => '请填写店铺名',
			'store_name.min'		    => '店铺名最少为2位',
			'store_name.max'		    => '店铺名超出最大字符限制',
			'store_mobile.required'	    => '请填写店铺联系电话',
			'store_type.required'		=> '请选择店铺类型',
			'store_class.required'		=> '请选择店铺经营范围',
			'province_id.required'		=> '请选择地址',
			'city_id.required'		    => '请选择地址',
			'area_id.required'			=> '请选择地址',
			'village_id.required'		=> '请选择所属小区',
			'lat.required'          	=> '请填写详细地址',
			'lng.required'		        => '请填写详细地址',
			'address.required'			=> '请填写详细地址',
			'business_img.required'		=> '请上传营业执照照片',
		];
	}
}
